<template>
    <div class="home-panel">
        <el-card class="box-card" shadow="hover">
            <!-- 头部标题 -->
            <template #header>
                <div class="card-header">
                    <span v-if="panelName">{{ panelName }}</span>
                    <template v-else>
                        <skeleton
                            width="60px"
                            height="20px"
                            style="margin-left: 5px"
                        ></skeleton>
                    </template>
                </div>
            </template>
            <el-scrollbar>
                <div class="card-body">
                    <template v-if="GoodsList && GoodsList.length">
                        <div
                            v-for="goods in GoodsList"
                            :key="Math.random().toString()"
                        >
                            <GoodsItem :goods="goods" />
                        </div>
                    </template>
                </div>
            </el-scrollbar>
        </el-card>
    </div>
</template>

<script setup>
defineProps({
    GoodsList: {},
    panelName: {},
    panelHeight: {
        default: 'auto',
    },
})
</script>

<style lang="scss" scoped>
.home-panel {
    position: relative;
    width: 1240px;
    margin-top: 20px;
}
.card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 18px;
}
.card-body {
    height: v-bind(panelHeight);
    display: flex;
    flex-direction: row;
    align-items: center;
}
</style>
